package com.mh.main.stock;

public class Price {

    public static void main(String[] args) {

//        double basePrice = 2.633;
        double basePrice = 2.72;
        double percent = 0.005;
        double totalPrice = 0.0; // 用于累积总和
        double gu = 20 * 100.0;// 股票数

        int range1Count = 0;
        int range2Count = 0;
        int range3Count = 0;
        int range4Count = 0;
        int range5Count = 0;

        System.out.println("====== 上限 ======");
        for (int i = 1; i <= 26; i++) {
            System.out.println(i + " ------ " + basePrice);

            // 根据不同的 basePrice 范围设置对应的 gu 值
            if (basePrice >= 3.0) {
//                gu = 11 * 100.0;
                range5Count++;
            } else if (basePrice >= 2.9) {
//                gu = 11 * 100.0;
                range1Count++;
            } else if (basePrice >= 2.8) {
//                gu = 1100.0;
                range2Count++;
            }
            else if (basePrice >= 2.7) {
//                gu = 1100.0;
                range3Count++;
            }
            else if (basePrice >= 2.6) {
//                gu = 1100.0;
                range4Count++;
            }

            totalPrice += basePrice * gu; // 累积总和
            basePrice = basePrice + basePrice * percent;
        }

        System.out.println("Total price: " + totalPrice);
        System.out.println("Range 1 Count: " + range1Count);
        System.out.println("Range 2 Count: " + range2Count);
        System.out.println("Range 3 Count: " + range3Count);
        System.out.println("Range 4 Count: " + range4Count);
        System.out.println("Range 5 Count: " + range5Count);




    }


}
